feat: auto-update outdated plugins at launch and add update UI in Settings#891
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56c38f91f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| replaceExistingPlugin(bundleId: registryPlugin.id) | ||
|
|
||
| let entry = try await installFromRegistry(registryPlugin, progress: progress) |
There was a problem hiding this comment.
Preserve existing plugin until registry update succeeds
updateFromRegistry unloads/removes the currently loaded plugin before any download/verification/install work is attempted. If installFromRegistry then fails (for example, no network, non-2xx response, or checksum mismatch), the user is left without the previously working plugin in the current session because it has already been removed from plugins and capabilities were unregistered.
Useful? React with 👍 / 👎.
| private func hasUpdate(for plugin: RegistryPlugin) -> Bool { | ||
| guard let installed = pluginManager.plugins.first(where: { $0.id == plugin.id }) else { return false } | ||
| return plugin.version.compare(installed.version, options: .numeric) == .orderedDescending |
There was a problem hiding this comment.
Detect updates for installed theme plugins
hasUpdate(for:) only compares versions against pluginManager.plugins, but installed themes are not stored there (they are tracked by ThemeRegistryInstaller). As a result, outdated installed themes always evaluate as having no update, so Browse keeps showing "Installed" and never exposes the new update action for theme plugins.
Useful? React with 👍 / 👎.
Summary
Test plan
.tablepluginwith oldTableProPluginKitVersion(e.g. 2) in~/Library/Application Support/TablePro/Plugins/, launch app, verify no error dialog appears and plugin loads